Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle file system permissions #11965

Merged
merged 3 commits into from
Dec 12, 2022
Merged

Handle file system permissions #11965

merged 3 commits into from
Dec 12, 2022

Conversation

msujew
Copy link
Member

@msujew msujew commented Dec 7, 2022

What it does

Closes #11509
Closes #199

This was more work than initially expected. It seems like we didn't handle readonly editors at all previously (see #199). So this change not only adds the file system permissions extension API, but also enables us to pass permission information all the way to the monaco model and phosphor tabbars.

How to test

  1. Download and install this test extension
  2. Run the 4 contributed Open file from file system commands. They should all result in read only editors except for the one that opens the mutable-in-mutable file.
  3. Readonly editors should be marked as such (a lock icon) and should behave that way (i.e. the document is not editable).
  4. Run the Check file system isWritableFileSystem command. Input different URI schemes which then displays a notification containing the result of the isWritableFileSystem call. The extension contributes the readonly and mutable file system schemes, which should return false/true respectively. Calls to file should also return true. Everything else should return undefined, unless contributed by an extension or plugin.

Review checklist

Reminder for reviewers

@msujew msujew added filesystem issues related to the filesystem vscode issues related to VSCode compatibility labels Dec 7, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me and work well 👍

  • confirmed the commands contributed by the plugin work as expected
  • confirmed that readonly editors display the lock decoration as a caption
  • confirmed that readonly editors are readonly from a monaco standpoint (with the default message as a user attempts to edit the file)

@JonasHelming
Copy link
Contributor

@colin-grant-work Do you want to have a look or can we merge this?

@colin-grant-work
Copy link
Contributor

It looks reasonable to me, though I haven't tested it. I'm fine with merging.

@dpetroff
Copy link

Closes #199

I'm not sure it does. In theia 1.36, I set some files to read only on the file system with chmod, and the resource, filestat, etc. all still say isReadOnly=false

@vince-fugnitto vince-fugnitto modified the milestones: 1.33.0, 1.37.0 Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem issues related to the filesystem vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vscode] Support querying whether file system and file stats are readonly Handle readonly files
5 participants